package {{.basepackage}}.service.impl;

import java.util.List;
import {{.basepackage}}.entity.{{.PascalName}};
import {{.basepackage}}.service.{{.PascalName}}Service;
import {{.basepackage}}.dao.{{.PascalName}}Dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.pinming.pmsuite.common.search.PagedSearchRequest;
import cn.pinming.pmsuite.persistence.PagedList;
import cn.pinming.pmsuite.persistence.Pagination;
import cn.pinming.pmsuite.utils.ReflectUtils;
import cn.pinming.pmsuite.service.impl.BaseServiceImpl;

/**
 * @version 1.0.0
 * @Project : {{.SiteName}}
 * @Package Name : {{.basepackage}}.service.impl.{{.PascalName}}ServiceImpl
 * @Company 杭州品茗信息技术有限公司
 * @Author 林芳崽 on {{ .CreateTime }}.
 * @Description: {{.table.TableComment}}数据库访问DAO层
 */
@Service("{{.PascalName}}Service")
public class {{.PascalName}}ServiceImpl  extends BaseServiceImpl<{{.PascalName}}> implements {{.PascalName}}Service {
	@Autowired
    private {{.PascalName}}Dao {{.CamelName}}Dao;

	public {{.PascalName}}ServiceImpl(){
		super({{.PascalName}}.class);
	}

	@Override
	public PagedList<{{.PascalName}}> getPaged(PagedSearchRequest<{{.PascalName}}> request){
		if(request==null){
			request=new PagedSearchRequest<{{.PascalName}}>();
		}
		Pagination pagination=request.toPagination();
		{{.PascalName}} filter=new {{.PascalName}}();
		ReflectUtils.fillObjectByMap(request.getFilter(),null,filter);
		List<{{.PascalName}}> list = {{.CamelName}}Dao.getPaged(filter,request.getSearchKey(),pagination,request.getFilter());
		return new PagedList<>(list,pagination);
	}


}
